-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Teams Page #134
Added Teams Page #134
Conversation
… Members. Also added proper sequential loading of Core Members
This reverts commit 4cd43dd.
Hey, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a bunch of comments. Please look into them when you get the time. Thanks!
# TODO: Phase out with GitHub OAuth details | ||
github = models.CharField( | ||
max_length=200, blank=True, null=True, verbose_name="GitHub Username" | ||
) | ||
is_nep = models.BooleanField(default=False, verbose_name="Is NEP Member?") | ||
date_joined = models.DateTimeField( | ||
default=datetime.now(), verbose_name="Date Joined" | ||
verbose_name="Date Joined", default=datetime.now() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use the django.utils.timezone.now()
function here instead?
|
||
|
||
class Core(models.Model): | ||
user = models.OneToOneField(User, null=False, on_delete=models.CASCADE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're decoupling Core and Faculty, I think this can be a OneToOne to ExecutiveMember
instead. Only Executive Members should have the ability to take core positions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey I tried doing that but now I have this issue when I try to makemigrations
It is impossible to add a non-nullable field 'executivemember' to core without specifying a default. This is because the database needs something to populate existing rows.
Please select a fix:
1) Provide a one-off default now (will be set on all existing rows with a null value for this column)
2) Quit and manually define a default value in models.py.
I tried deleting all pre-existing model instances from the db and it still throws the error. How can I fix this? It has bugged me a lot in the past too lol.
Further, I cannot open the Core model menu in the django-admin site. It throws this error page at me:
Plx help
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do the following:
- Stop all running containers -
docker kill $(docker ps -a -q)
- Delete the DB volume -
docker volume rm postgres_data
- (Optional) Prune your system -
docker system prune
- Restart all containers -
docker compose up --build
Note that this will nuke your existing data in the DB. If you've created temp users and other things, maybe try to dump the data using dumpdata
Co-authored-by: Nishant Nayak <[email protected]>
Co-authored-by: Nishant Nayak <[email protected]>
Description
Added Teams Page for CompSoc, Diode, Piston and IEEE members. Added Core and Faculty models along with profile picture fields.
Fixes # (issue)
#38
Dependencies
List any dependencies that are required for this change.
Type of Change
What types of changes does your code introduce?
Put an
x
in the boxes that applyHow Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration. (for bug fix / breaking change)
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.